home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 May / may_2001.iso / intercd / root / ^Php / php album / VERSION3 / ALBUM.PHP < prev    next >
Encoding:
PHP Script  |  2001-02-18  |  1.9 KB  |  60 lines

  1. <?php
  2.     /* album.php - version 3
  3.      * .net magazine (www.netmag.co.uk), issue 83
  4.      * Matt Kynaston, 2001
  5.      * Distributed under the GNU Public License - www.gnu.org/copyleft/gpl.html
  6.      *
  7.      * The PHP Photo Album displays the contents of a thumbnail directory,
  8.      * linked to full size images in the photo directory. It gives the user
  9.      * the opportunity to upload their own photos to the album, automatically
  10.      * creating tumbnails.
  11.      *
  12.      * Requires PHP4 with the GD and ZLIB extensions installed (php_gd.dll and php_zlib.dll
  13.      * on Windows). These are available from the full download of PHP at www.php.net
  14.      * Modify your php.ini file (C:\WINDOWS\PHP.INI in Windows systems) to point at them
  15.     */
  16.      
  17.     /* constant declaration section
  18.      * change these to modify the album directories or image sizes
  19.     */
  20.     define("NUM_COLS", 4); // number of columns in table
  21.     define("PHOT_DIR", "photos"); // photo directory, relative to this page
  22.     define("THUMB_DIR", "thumbs"); // thumbnail directory, relative to this page
  23.     define("MAX_XY", 150); // maximum width or height of thumbnail image
  24.  
  25.     /* all the functions used on this page have been split off into a 
  26.      * seperate file. The include statement below makes them available to this
  27.      * page.
  28.     */
  29.     include("album_functions.php");    
  30.  
  31. ?>
  32. <html>
  33. <head>
  34. <title>Photo Album</title>
  35. <link href="album.css" rel="stylesheet" type="text/css">
  36. </head>
  37.  
  38. <body bgcolor="#FFFFFF" text="#000000">
  39. <h1>PHP Photo Album</h1>
  40. <h3>(final version)</h3>
  41.  
  42. <?php uploadFile() ?>
  43.  
  44. <form name="form1" method="post" action="<?php print $PHP_SELF?>" enctype="multipart/form-data">
  45.   <p>Add your own image to the album:<br>
  46.     <input type="file" name="ulFile">
  47.     <input type="hidden" name="MAX_FILE_SIZE" value="512000">
  48.   </p>
  49.   <p>
  50.     <input type="submit" name="Submit" value="Upload">
  51.   </p>
  52. </form>
  53.  
  54. <p> </p>
  55.  
  56. <?php makeAlbumTable(); ?>
  57.  
  58. </body>
  59. </html>
  60.